package cn.chenhuanming.shh.administer.entity.jpa;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * HouseOrderApply entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "house_order_apply", catalog = "house")
public class HouseOrderApply implements java.io.Serializable {

	// Fields

	private Integer id;
	private UserBroker userBroker;
	private House house;
	private String proposerName;
	private String proposerPhone;
	private String message;
	private String orderStatus;
	private String status;

	// Constructors

	/** default constructor */
	public HouseOrderApply() {
	}

	/** minimal constructor */
	public HouseOrderApply(UserBroker userBroker, House house,
			String proposerName, String proposerPhone, String orderStatus,
			String status) {
		this.userBroker = userBroker;
		this.house = house;
		this.proposerName = proposerName;
		this.proposerPhone = proposerPhone;
		this.orderStatus = orderStatus;
		this.status = status;
	}

	/** full constructor */
	public HouseOrderApply(UserBroker userBroker, House house,
			String proposerName, String proposerPhone, String message,
			String orderStatus, String status) {
		this.userBroker = userBroker;
		this.house = house;
		this.proposerName = proposerName;
		this.proposerPhone = proposerPhone;
		this.message = message;
		this.orderStatus = orderStatus;
		this.status = status;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "broker_username", nullable = false)
	public UserBroker getUserBroker() {
		return this.userBroker;
	}

	public void setUserBroker(UserBroker userBroker) {
		this.userBroker = userBroker;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "house_id", nullable = false)
	public House getHouse() {
		return this.house;
	}

	public void setHouse(House house) {
		this.house = house;
	}

	@Column(name = "proposer_name", nullable = false, length = 20)
	public String getProposerName() {
		return this.proposerName;
	}

	public void setProposerName(String proposerName) {
		this.proposerName = proposerName;
	}

	@Column(name = "proposer_phone", nullable = false, length = 20)
	public String getProposerPhone() {
		return this.proposerPhone;
	}

	public void setProposerPhone(String proposerPhone) {
		this.proposerPhone = proposerPhone;
	}

	@Column(name = "message")
	public String getMessage() {
		return this.message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	@Column(name = "order_status", nullable = false, length = 4)
	public String getOrderStatus() {
		return this.orderStatus;
	}

	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}

	@Column(name = "status", nullable = false, length = 3)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

}